<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="Open Source Flash-based Code Editor with Syntax Hightlight, support many languages including ASP.Net/JSP/PHP C#/Java/C++/Javascript/VBScript/HTML/XML/SQL" />
<title>Flash-based Code Editor with Syntax Hightlight </title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<link href="http://fonts.googleapis.com/css?family=Overlock+SC" rel="stylesheet" type="text/css" />
<style type="text/css">
html, body { padding:0px; margin:0px; background-color:#D6D6D6; font-family:"Courier New", Courier, monospace; }
h1 { font-family: 'Overlock SC', cursive; margin:0 auto; }
h2 { font-family: 'Overlock SC', cursive; margin:10px 0px 0px 0px; padding:0px; }
.buttons { list-style-type:none; list-style-position:outside; margin:0px; padding:0px; clear:both; }
.buttons li { float:left }
.buttons label { font-size:12px;  line-height:20px;  }
.buttons input { }
p { font-size:12px; }
p .keywords { color:#800; }
</style>

</head>

<body>

<div style="width:100%; height:80px; background-color:#232323" >
<h1 style="color:white; text-align:center; line-height:80px; vertical-align:middle; font-size:24px">
	Open Source Online Code Editor with Syntax Hightlight
</h1>
</div>
<div style="width:100%; height:40px; background-color:#333333; border-top:1px solid #383838; border-bottom:1px solid #444444;" >
<p style="text-align:center; color:white">Flash-based code editor with syntax highlighting, it is free and open-source, and easy to be integrated into your site.</p>
</div>

<div style="width:1000px; margin:20px auto; display:block; overflow:hidden">
	<div>
    	<a href="http://code.google.com/p/code-syntax-highlight-editor/downloads/list" target="_blank" title="Download code-syntax-highlight-editor">Download Latest Release</a>
        |
        <a href="http://code.google.com/p/code-syntax-highlight-editor/source/checkout" target="_blank" title="Get code-syntax-highlight-editor source code">Get Source Code</a>
    </div>
    <h2 style="font-size:20px">Demo</h2>
    <hr />
	<div>
    	
        <ul class="buttons">
        <li><span>Languages : <span></li>
        <li>
    	<input id="btnASP" type="radio" name="language" value="asp" disabled="disabled"/></li></li><label for="btnASP">ASP</label>
        </li></li>
        <input id="btnASPX" type="radio" name="language" value="aspx" disabled="disabled"/></li></li><label for="btnASPX">ASP.Net</label>
        </li></li>
        <input id="btnPHP" type="radio" name="language" value="php" disabled="disabled"/></li></li><label for="btnPHP">PHP</label>
        </li></li>
        <input id="btnJSP" type="radio" name="language" value="jsp" disabled="disabled"/></li></li><label for="btnJSP">JSP</label>
        </li></li>
        <input id="btnJAVA" type="radio" name="language" value="java" disabled="disabled"/></li></li><label for="btnJAVA">Java</label>
        </li></li>
        <input id="btnCS" type="radio" name="language" value="csharp" disabled="disabled"/></li></li><label for="btnCS">C#</label>
        </li></li>
        <input id="btnCPP" type="radio" name="language" value="cpp" disabled="disabled"/></li></li><label for="btnCPP">C++</label>
        </li></li>
        <input id="btnJS" type="radio" name="language" value="javascript" disabled="disabled" checked="checked" /></li></li><label for="btnJS">JavaScript</label>
        </li></li>
        <input id="btnSQL" type="radio" name="language" value="sql" disabled="disabled"/></li></li><label for="btnSQL">SQL</label>
        </li></li>
        <input id="btnXML" type="radio" name="language" value="xml" disabled="disabled"/></li></li><label for="btnXML">XML</label>
        </li></li>
        <input id="btnCSS" type="radio" name="language" value="css" disabled="disabled"/></li></li><label for="btnCSS">CSS</label>
        </li></li>
        <input id="btnHTML" type="radio" name="language" value="html" disabled="disabled"/></li></li><label for="btnHTML">HTML</label>
        </li>
        </ul>
    </div>
    <div style="clear:both"></div>
	<div id="flash-loader">
    </div>
    
    <div>
    <h2 style="font-size:20px">Using the editor</h2>
    <hr />
    <p>The editor is loaded as flash in HTML page. First download the flash and put it into your web site. it is strongly recommended that load the editor via <a href="http://code.google.com/p/swfobject/" target="_blank">swfobject</a>. The following line embeds swfobject library from Google CDN.
    </p>
    <p>
    <span class="keywords">&lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"&gt;&lt;/script&gt;</span>
    </p>
    <p>
    Next, load the editor via <span class="keywords">swfobject.embedSWF</span> method. You are able to find enough comments between the lines above if you switch to "JavaScript" radio button. Also you can find details about the initialization options in next section.
    </p>
    <p>
    After the editor is loaded, you are able to do extra initialization within the javascript callback function (i.e. load the content into the editor). You can control the editor via invoking its methods from javascript. For details, please refer to "Methods" section.
    </p>
    
    <h2 style="font-size:20px">Options</h2>
    <hr />
    <p>The following options can be set to the flashvar when initialize the editor.</p>
    <ul>
    	<li><strong>parser</strong>
        	<p>A string value indicating the language parser of the editor.
            <br /> It can be any one of the following values :
            <br /> <span class="keywords">asp</span> / <span class="keywords">aspx</span> / <span class="keywords">php</span> / <span class="keywords">jsp</span> / <span class="keywords">java</span> / <span class="keywords">csharp</span> / <span class="keywords">cpp</span> / <span class="keywords">javascript</span> / <span class="keywords">sql</span> / <span class="keywords">xml</span> / <span class="keywords">css</span> / <span class="keywords">html</span>.</p>
        </li>
        <li><strong>onload</strong>
        	<p>A string value indicating the javascript callback function. After the editor is initialized, the callback function is called. Extra initialization can be done within the callback function.</p>
        </li>
        <li><strong>readOnly [Optional]</strong> 
        <p>A boolean value indicating if the editor is initialized as readOnly mode.</p>
        </li>
        <li><strong>preferredFonts [Optional]</strong>
        	<p>A string value indicating the preferred font list. The editor detects the installed fonts on the machine, and choose the most preferred font.  The default preferred font list is "<span class="keywords">|Consolas|Courier New|Courier|Arial|Tahoma|</span>". The font list must start and end with the vertical bar charactor "<span class="keywords">|</span>" </p>
        </li>
        <li><strong>fontSize [Optional]</strong> 
        	<p>A integer value indicating the font size in pixel. Default font size is <span class="keywords">12</span>.</p></li>
    </ul>
    
    <h2 style="font-size:20px">Methods</h2>
    <hr />
    <p>The following methods can be invoked via javascript once the editor is initialized.</p>
    <ul>
    	<li><strong>setParser(parseName:String)</strong>
        	<p>Change the language parser of the editor. parseName can be any one of the following values :
            	<span class="keywords">asp</span> / <span class="keywords">aspx</span> / <span class="keywords">php</span> / <span class="keywords">jsp</span> / <span class="keywords">java</span> / <span class="keywords">csharp</span> / <span class="keywords">cpp</span> / <span class="keywords">javascript</span> / <span class="keywords">sql</span> / <span class="keywords">xml</span> / <span class="keywords">css</span> / <span class="keywords">html</span>
            </p>
        </li>
        <li><strong>setReadOnly(readOnly:Boolean)</strong>
        	<p>Enable / Disable readOnly mode of the editor.
            <button type="button" onclick="document.getElementById('ctlFlash').setReadOnly(true)" disabled="disabled">setReadOnly(true)</button>
            <button type="button" onclick="document.getElementById('ctlFlash').setReadOnly(false)" disabled="disabled">setReadOnly(false)</button>
            </p>
        </li>
        <li><strong>setText(content:String)</strong>
        	<p>Set the content of the editor.
            <button type="button" onclick="document.getElementById('ctlFlash').setText('')" disabled="disabled">clear the content</button>
            </p>
        </li>
        <li><strong>insertText(content:String)</strong>
        	<p>Replace the current selected text in the editor.
            <button type="button" onclick="document.getElementById('ctlFlash').insertText('XXXXXXXXXXXXXXXXXXXXXXXXXXXXX')" disabled="disabled">insertText('XXXXXXXXXXXXXXXXXXXXXXXXXXXXX')</button>
            <br />
            NOTE : this method will do nothing if the editor is in readOnly mode.</p>
        </li>
        <li><strong>getText(content:String)</strong>
        	<p>Get the content of the editor. Usually this method is used to gather the content and then submit the content to server in your preferred way.
            <button type="button" onclick="alert(document.getElementById('ctlFlash').getText())" disabled="disabled">getText()</button>
            </p>
        </li>
    </ul>
    </div>
</div>




<textarea id="aspx" style="display:none">&lt;%@ Page Title="&lt;%$ Resources: TitleText %&gt;" Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %&gt;
&lt;%@ Import Namespace="System.Data" %&gt;

&lt;script language="C#" runat="server"&gt;
// inline server code
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    if( !Page.IsPostBack )  ctlGrid.DataBind();
}
&lt;/script&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
    &lt;title&gt;Code Syntax Highlight Editor&lt;/title&gt;

    &lt;style type="text/css"&gt;
    	&lt;!--
		body { background-color:#030; } /* inline style */
		-->
    &lt;/style&gt;

    &lt;script type="text/javascript" language="javascript"&gt;
    	&lt;![CDATA[    	
		// inline javascript code and inline server code
		alert( '&lt;%: this.Modal %&gt;' );
		]]&gt;		
	&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;
	
	&lt;div&gt;
    	&lt;asp:DataGrid id="itemslist" AutoGenerateColumns="false" AlternatingItemStyle-BackColor="beige" BorderColor="black" BorderWidth="1" CellPadding="3" Font-Name="Verdana" Font-Size="10pt" HeaderStyle-BackColor="DarkGreen" HeaderStyle-Font-Bold="True" HeaderStyle-ForeColor="Beige" DataKeyField="Quantity" runat="server"&gt; 
        &lt;Columns&gt;
            &lt;asp:BoundColumn HeaderText="&lt;%$ Resources: ProductName %&gt;" DataField="Name" /&gt;
            &lt;TemplateColumn HeaderText="Quantity"&gt;
                &lt;ItemTemplate&gt;
                    &lt;center&gt;
                        &lt;asp:label id="ProductID" visible="false" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "ProductID") %&gt;' /&gt;
                        &lt;asp:label id="Bonus" visible="false" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "Bonus") %&gt;' /&gt;
                        &lt;asp:TextBox id="Quantity" runat="server" Columns="3" Text='&lt;%# DataBinder.Eval(Container.DataItem, "Quantity") %&gt;' width="40px" /&gt;
                    &lt;/center&gt;
                &lt;/ItemTemplate&gt;
            &lt;/TemplateColumn&gt;
		&lt;/Columns&gt;
		&lt;/asp:DataGrid&gt;
		&lt;input type="button" runat="server" value="Refresh" /&gt;
    &lt;/div&gt;

	&lt;%-- Server side comments --%&gt;
	&lt;!-- Client side comments --&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea>
<textarea id="asp" style="display:none">&lt;%@ CodePage=65001 Language="VBScript"%&gt;
&lt;% Option Explicit %&gt;
&lt;!--#include file="_db.asp"--&gt;
&lt;html&gt;
&lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9"&gt;
        &lt;link rel="StyleSheet" HREF="surveyadmin.css" type="text/css"&gt;
        &lt;title&gt;Survey&lt;/title&gt;
&lt;/head&gt;

&lt;body bgcolor="&lt;= BgColor&gt;"&gt;

&lt;%

        lAnketID = request("ID")

        set conn = Server.CreateObject("ADODB.Connection")
        Set rs = Server.CreateObject("ADODB.Recordset")
        conn.open sConnAnket
        set rs.ActiveConnection = conn
        rs.CursorType = adOpenStatic

        sSQL = "SELECT SurveyID, SurveyName, SurveyQuestion FROM Surveys WHERE SurveyID = " & lAnketID
        rs.Open sSQL, , , adCmdTable

        if rs.eof or rs.bof then
                response.write "Error : Survey not found&lt;br&gt;Survey ID:" & lAnketID
                response.end
        end if

        sSurveyName = rs("SurveyName")
        sSurveyQuestion = rs("SurveyQuestion")

        rs.close

%&gt;
&lt;form action="cast.asp?ID=&lt;%=lAnketID%&gt;" method="post"&gt;
&lt;table border="0" cellspacing="1" cellpadding="2" width="100%" bgcolor="#ffe4b5"&gt;
        &lt;tr&gt;
                &lt;td class="header2"&gt;&lt;%=sSurveyQuestion%&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;%
        sSQL = "SELECT OptionID, OptionText FROM Options WHERE SurveyID = " & lAnketID
        rs.Open sSQL, , , adCmdTable

        do while not rs.eof
        %&gt;
                &lt;tr&gt;
                        &lt;td class="smalltext"&gt;
                                &lt;input type="radio" name="optSecenek" value="&lt;%=rs("OptionID")%&gt;"&gt;
                                &lt;%=rs("OptionText")%&gt;
                        &lt;/td&gt;
                &lt;/tr&gt;
        &lt;%
                rs.movenext
        loop
        rs.close
        %&gt;
        &lt;tr&gt;
                &lt;td align=right&gt;&lt;input type="submit" name="cmdOyVer" value=" Send " class="flatbutton"&gt;
                &lt;/td&gt;
        &lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
</textarea>

<textarea id="php" style="display:none">&lt;?php
// PHP_VERSION_ID is available as of PHP 5.2.7, if our 
// version is lower than that, then emulate it
if (PHP_VERSION_ID &lt; 50207) {
    define('PHP_MAJOR_VERSION',   $version[0]);
    define('PHP_MINOR_VERSION',   $version[1]);
    define('PHP_RELEASE_VERSION', $version[2]);

    // and so on, ...
}
?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Code Syntax Highlight Editor&lt;/title&gt;

    &lt;style type="text/css"&gt;
        body { background-color:#030; } /* inline style */
    &lt;/style&gt;

	&lt;script type="text/javascript" language="javascript"&gt;
        // inline javascript and side side code
		var ver = '&lt;?=$version[1]?&gt;';
	&lt;/script&gt;
&lt;/head&gt;
&lt;body &gt;&lt;?=$version[0]?&gt;&lt;/pre&gt;&lt;/body&gt;
&lt;/html&gt;
</textarea>

<textarea id="sql" style="display:none">insert into table1(field1,field2) values(value1,value2)

delete from table1 where Time between '2010-01-01' AND GETDATE()

update table1 set field1=value1 where Time between '2010-01-01' AND GETDATE()

select * from table1 where field1 like '%value1%' -- comments
</textarea>

<textarea id="csharp" style="display:none">// Hello3.cs
// arguments: A B C D
using System;

public class Hello3
{
   public static void Main(string[] args)
   {
      Console.WriteLine(@"Please say ""
	  Hello, World""!");
      Console.WriteLine("You entered the following \"{0}\" command line arguments:",
         args.Length );
      for (int i=0; i < args.Length; i++)
      {
         Console.WriteLine("{0}", args[i]); 
      }
   }
}
</textarea>

<textarea id="javascript" style="display:none">// initialize with parameters
var flashvars = {
	// indicate the parser, aspx / csharp / javascript / css / vbscript / html / xml / php / phpcode
	parser: "javascript",
	
	// set the editor to read-only mode
	readOnly: false,	

	// the editor detects client installed fonts and use preferred fonts if installed.
	// NOTE: the vertical bar charactor is required at the begin and end of the list
	preferredFonts : "|Consolas|Courier New|Courier|Arial|Tahoma|",
	
	// font size
	fontSize : 12,

	// indicate the callback function so that we can load the content into editor once it is initialized.
	onload : "onEditorLoaded"		
};

// flash player parameters, you can find more information at: http://code.google.com/p/swfobject/wiki/documentation
var params = { menu: "false", /* wmode : "transparent", */allowscriptaccess : "always" };

// define the id of the flash control, we need the id in javascript interaction 
var attributes = { id: "ctlFlash", name: "ctlFlash" };

// embed the flash with size, more information can be found at: http://code.google.com/p/swfobject/wiki/documentation
swfobject.embedSWF("./bin-release/CodeHighlightEditor.swf?_=" + (new Date()).getTime(), "flash-loader", "100%", "400", "10.0.0", null, flashvars, params, attributes);
</textarea>

<textarea id="java" style="display:none">package hello;

import java.io.* ;

/**
 * &lt;p&gt;
 * A simple Hello World class, used to demonstrate some
 * features of Java source highlighting.
 * &lt;/p&gt;
 * TODO: nothing, just to show an highlighted TODO or FIXME
 *
 * @author Lorenzo Bettini
 * @version 2.0
 */
public class Hello {
    int foo = 1998 ;
    int hex_foo = 0xCAFEBABE;
    boolean b = false;
    Integer i = null ;
    char c = '\'', d = 'n', e = '\\' ;
    String xml = "&lt;tag attr=\"value\"&gt;Url&lt;/tag&gt;", foo2 = "\\" ;

    public static void main( String args[] ) {
        // just some greetings ;-)  /*
        System.out.println( "Hello from java2html :-)" ) ;
        System.out.println( "\tby Lorenzo Bettini" ) ;
        System.out.println( "\thttp://www.lorenzobettini.it" ) ;
        if (argc &gt; 0)
            String param = argc[0];
        //System.out.println( "bye bye... :-D" ) ; // see you soon
    }
}
</textarea>

<textarea id="jsp" style="display:none">&lt;%@ page isThreadSafe="false" autoFlush="true"%&gt;
&lt;%@ page import="java.io.*,java.util.*" %&gt;
&lt;jsp:useBean id="fop" scope="page" class="xsl.FOPBean" /&gt;
&lt;jsp:setProperty name="fop" property="*"/&gt;

&lt;%-- Server side comments --%&gt;
&lt;%!
    /**
     * test for resource on the classpath
     * @param resource
     * @return true iff present
     */
    boolean resourceExists(String resource) {
        boolean found;
        InputStream instream=this.getClass().getResourceAsStream(resource);
        found=instream!=null;
        if(instream!=null) {
            try {
                instream.close();
            } catch (IOException e) {
            }
        }
        return found;
    }
%&gt;

&lt;html&gt;
		&lt;head&gt;
			&lt;style type="text/css"&gt;
				body { background:White; } /* inline css */
			&lt;/style&gt;
            
            &lt;script language="javascript" type="text/javascript"&gt;
			// inline javascript and server script
			var a = '&lt;%= fop.getStyle()%&gt;';
			&lt;/script&gt;
        &lt;/head&gt;
        &lt;body bgcolor="#FFFFFF" text="#000000"&gt;
            &lt;a href="&lt;%=fop.getStyle()%&gt;"&gt;XSL-File&lt;/A&gt;&nbsp;&nbsp;&nbsp;
            &lt;a href="&lt;%=fop.getSource()%&gt;"&gt;XML-File&lt;/A&gt;&lt;br&gt;
        &lt;hr&gt;


&lt;%
        File dir = new File("/SYSTEM/PATH/xsl/pdf");
        if (!dir.isDirectory()) throw new Exception("Error!");
        File file = fop.process(dir);
%&gt;
        &lt;H2&gt;Ihr PDF-File&lt;/H2&gt;
        &lt;p&gt;
            &lt;A href="/SERVER/PATH/xsl/pdf/&lt;%=file.getName()%&gt;"&gt;PDF FILE&lt;/A&gt;
        &lt;/p&gt;

        &lt;/body&gt;
&lt;/html&gt;
</textarea>

<textarea id="cpp" style="display:none">
#include &lt;iostream&gt;
using namespace std;

int main ()
{
  cout &lt;&lt; " \"Hello World\"! ";     // prints Hello World!
  cout &lt;&lt; "I'm a C++ program" &lt;&lt; '\''; // prints I'm a C++ program
  return 0;
}</textarea>

<textarea id="xml" style="display:none">&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
&lt;!DOCTYPE scenario SYSTEM "sipp.dtd"&gt;

&lt;scenario name="registration and simple IMS session setup, client side"&gt;
	&lt;send retrans="500"&gt;
	&lt;![CDATA[
	REGISTER sip:open-ims.test SIP/2.0
	Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
	Max-Forwards: 20
	From: "bob" &lt;sip:bob@open-ims.test&gt;;tag=[call_number]
	To: "bob" &lt;sip:bob@open-ims.test&gt;
	P-Access-Network-Info: 3GPP-UTRAN-TDD;utran-cell-id-3gpp=C359A3913B20E
	Call-ID: reg///[call_id]
	CSeq: 1 REGISTER
	Contact: &lt;sip:bob@[local_ip]:[local_port]&gt;
	Expires: 300
	Content-Length: 0
	User-Agent: Sipp v1.1-TLS, version 20061124
	Authorization: Digest username="bob@open-ims.test", realm="open-ims.test"
	Supported: path
	]]&gt;
	&lt;/send&gt;

	&lt;!-- definition of the response time repartition table (unit is ms)   --&gt;
	&lt;ResponseTimeRepartition value="10, 20"/&gt;
		
	&lt;!-- definition of the call length repartition table (unit is ms)     --&gt;
	&lt;CallLengthRepartition value="10"/&gt;
		
&lt;/scenario&gt;
</textarea>

<textarea id="css" style="display:none">h1 { color: white; background-color: orange !important; }
h2 { color: white; background-color: green !important; }
body
{
	background-color:#d0e4fe;
}
h1
{
	color:orange;
	text-align:center;
}
p
{
	font-family:"Times New Roman";
	font-size:20px;
}
</textarea>

<textarea id="html" style="display:none">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Samle&lt;/title&gt;

&lt;style type="text/css"&gt;
body { background:#000033 }
h1 { font-family:Georgia, "Times New Roman", Times, serif; font-size:12px; }
ul li
{
	padding-left:10px
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
	&lt;table lang="af" dir="rtl" &gt;
    	&lt;tr&gt;
        	&lt;td&gt;No,&lt;/td&gt;
            &lt;td&gt;Size&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
        	&lt;td&gt;1&lt;/td&gt;
            &lt;td&gt;59&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea>
<br />

<div id="flashContent" style="width:100%">
</div>   


<script type="text/javascript">
function onEditorLoaded(){
	// call setText to load content into editor
	document.getElementById('ctlFlash').setText( document.getElementById('javascript').value );
	
	// enable the radio buttons
	var buttons = document.getElementsByTagName('input');
	for( var i = 0; i < buttons.length; i++){
		if( buttons[i].type == 'radio' ) {
			buttons[i].disabled = false;
			buttons[i].setAttribute('autocomplete', 'off');
			
			var lang = buttons[i].value;
			var fun = (function(v){
				return function(){
					document.getElementById('ctlFlash').setParser(v);
					document.getElementById('ctlFlash').setText( document.getElementById(v).value );
				};
			})(lang);
			buttons[i].onclick = fun;
		}
	}
	
	var buttons = document.getElementsByTagName('button');
	for( var i = 0; i < buttons.length; i++){
		buttons[i].disabled = false;
	}
}


// initialize with parameters
var flashvars = {
	// indicate the parser, aspx / csharp / javascript / css / vbscript / html / xml / php / phpcode
	parser: "javascript",
	
	// set the editor to read-only mode
	readOnly: false,	

	// the editor detects client installed fonts and use preferred fonts if installed.
	// NOTE: the charactor '|' is required at the begin and end of the list
	preferredFonts : "|Consolas|Courier New|Courier|Arial|Tahoma|",
	
	// font size
	fontSize : 12,

	// indicate the callback function so that we can load the content into editor once it is initialized.
	onload : "onEditorLoaded"		
};

// flash player parameters, you can find more information at: http://code.google.com/p/swfobject/wiki/documentation
var params = { menu: "false", /* wmode : "transparent", */allowscriptaccess : "always" };

// define the id of the flash control, we need the id in javascript interaction 
var attributes = { id: "ctlFlash", name: "ctlFlash" };

// embed the flash with size, more information can be found at: http://code.google.com/p/swfobject/wiki/documentation
swfobject.embedSWF("./bin-release/CodeHighlightEditor.swf?_=" + (new Date()).getTime(), "flash-loader", "100%", "420", "10.0.0", null, flashvars, params, attributes);











if( window.location.protocol != 'http:' ) {
	alert( 'Please open the demo page via http protocol!' );
}

function loadContent( lang, textarea){
	document.getElementById('ctlFlash').setParser(lang);
	document.getElementById('ctlFlash').setText( document.getElementById(textarea).value );
}
</script>


</body>
</html>
